home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / amos / keyfilemaker.lha / Keyfile / Keyfilemaker.AMOS / Keyfilemaker.amosSourceCode
AMOS Source Code  |  1999-06-19  |  981b  |  48 lines

  1. ' Keyfilemaker v1.0 [990619]   
  2. ' By Nikolaos Theologou (wizbone@hem.passagen.se)  
  3.  
  4. Screen Open 0,640,200,4,Hires
  5. Curs Off : Cls 0 : Paper 0 : Flash 3,"(fff,5)(000,5)"
  6. Print "Program Keyfile maker by Nikoaos Theologou"
  7. Print "------------------------------------------"
  8. Input "Name:";NAME$
  9. Input "ID:";ID
  10.  
  11. NAMELEN=Len(NAME$)
  12.  
  13. ' Calculate the checksum of the name 
  14.  
  15. For I=1 To NAMELEN
  16.  Add CHEKSUM,Asc(Right$(Left$(NAME$,I),1))
  17. Next 
  18.  
  19. ' Encryption of the name 
  20.  
  21. ' Mirror it    
  22.  
  23. For I=1 To NAMELEN
  24.  TEMP$=TEMP$+Chr$(Asc(Right$(Left$(NAME$,NAMELEN+1-I),1)))
  25. Next : NAME$=TEMP$ : TEMP$=""
  26.  
  27. ' Encrypt it (Add I*5)   
  28.  
  29. For I=1 To NAMELEN
  30.  TEMP$=TEMP$+Chr$(Asc(Right$(Left$(NAME$,I),1))+(I*2))
  31. Next : NAME$=TEMP$ : TEMP$=""
  32.  
  33. ' Minimize the checksum
  34.  
  35. While CHEKSUM>255 : CHEKSUM=CHEKSUM-255 : Wend 
  36.  
  37. ' Make the file
  38.  
  39. Open Out 1,"Program.key"
  40.  Print #1,Chr$(CHEKSUM);
  41.  Print #1,Chr$(ID+CHEKSUM);
  42.  Print #1,Chr$(ID+20);
  43.  Print #1,NAME$
  44. Close 1
  45.  
  46. Print : Print "Program.key created..."
  47.  
  48. Edit